package com.tool.payment.model;

import java.util.Date;

public class PayOrder {
	
	/**微信支付**/
	public static final int PAYPRODUCT_WEIXIN = 1;
	/**支付宝支付**/
	public static final int PAYPRODUCT_ALIPAY = 2;
	/**月额支付**/
	public static final int PAYPRODUCT_ACCOUNT = 3;
	/**未支付**/
	public static final int STATUS_NO = 1;
	/**支付成功**/
	public static final int STATUS_SUCCESS = 2;
	/**支付取消**/
	public static final int STATUS_CANCEL = 3;
	/**支付失败**/
	public static final int STATUS_FAIL = 4;
	/**收款**/
	public static final int TYPE_USERPAY = 100;
	/**退款**/
	public static final int TYPE_REFUNDTOUSER = 200;
	

	private Long id;
	
	private Date createtime;
	
	private Integer version;
	/**
	 * 支付工具 1 微信 2 支付宝 3余额
	 */
	private Integer payproduct;
	/**
	 * 支付状态 1 未支付 2 已支付 3 取消 4 失败
	 */
	private Integer status;
	/**
	 * 支付类型 100 收款(用户支付) 200退款(给用户退钱)
	 */
	private Integer type;
	/**
	 * 商品订单id
	 */
	private Long workid;
	/**
	 * 支付金额 单位分
	 */
	private Integer money;
	/**
	 * 支付账号
	 */
	private String payaccount;
	/**
	 * 操作人
	 */
	private Long operateid;
	/**
	 * 修改日期
	 */
	private Date updatetime;
	/**
	 * 外部订单号
	 */
	private String outtradeno;
	
	private String memo;
	
	public PayOrder() {
		
	}
	
	public PayOrder(Long id) {
		this.id = id;
	}
	
	public PayOrder(Long id,Integer payproduct, Integer type, Long workid, Integer money,
			String payaccount, Long operateid) {
		super();
		this.id = id;
		this.createtime = new Date();
		this.updatetime = this.createtime;
		this.version = 0;
		this.payproduct = payproduct;
		this.status = STATUS_NO;
		this.workid = workid;
		this.money = money;
		this.payaccount = payaccount;
		this.operateid = operateid;
		this.type = type;
	}
	
	public PayOrder(Long id,Integer payproduct, Integer type, Long workid, Integer money, Long operateid) {
		super();
		this.id = id;
		this.createtime = new Date();
		this.updatetime = this.createtime;
		this.version = 0;
		this.payproduct = payproduct;
		this.status = STATUS_NO;
		this.workid = workid;
		this.money = money;
		this.operateid = operateid;
		this.type = type;
	}
	
	public PayOrder(Long id,int type,String outtradeno,Integer money,String memo) {
		this.id = id;
		this.type = type;
		this.outtradeno = outtradeno;
		this.money = money;
		this.memo = memo;
	}

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Date getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	public Integer getVersion() {
		return version;
	}
	public void setVersion(Integer version) {
		this.version = version;
	}
	public Integer getPayproduct() {
		return payproduct;
	}
	public void setPayproduct(Integer payproduct) {
		this.payproduct = payproduct;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Long getWorkid() {
		return workid;
	}
	public void setWorkid(Long workid) {
		this.workid = workid;
	}
	public Integer getMoney() {
		return money;
	}
	public void setMoney(Integer money) {
		this.money = money;
	}
	public String getPayaccount() {
		return payaccount;
	}
	public void setPayaccount(String payaccount) {
		this.payaccount = payaccount;
	}
	public Long getOperateid() {
		return operateid;
	}
	public void setOperateid(Long operateid) {
		this.operateid = operateid;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Date getUpdatetime() {
		return updatetime;
	}

	public void setUpdatetime(Date updatetime) {
		this.updatetime = updatetime;
	}

	public String getOuttradeno() {
		return outtradeno;
	}

	public void setOuttradeno(String outtradeno) {
		this.outtradeno = outtradeno;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Override
	public String toString() {
		return "PayOrder [id=" + id + ", createtime=" + createtime
				+ ", version=" + version + ", payproduct=" + payproduct
				+ ", status=" + status + ", type=" + type + ", workid="
				+ workid + ", money=" + money + ", payaccount=" + payaccount
				+ ", operateid=" + operateid + ", updatetime=" + updatetime
				+ ", outtradeno=" + outtradeno + ", memo=" + memo + "]";
	}
	
}
